/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao.impl;

import org.hibernate.Query;
import dao.ThamSoDAO;
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import pojo.ThamSo;

/**
 *
 * @author MongKieu
 */
public class ThamSoDAOImpl extends HibernateDaoSupport implements ThamSoDAO {

    @Override
    public ThamSo getThamSoByMaThamSo(int maThamSo) {
        String myquery = "from ThamSo where Id=" + maThamSo;
        Query q = getSession().createQuery(myquery);
        List list = q.list();
        return (ThamSo) list.get(0);
    }

    @Override
    public List<ThamSo> listThamSo() {
        return getHibernateTemplate().find("from ThamSo");

    }
}
